﻿using System;
using System.Collections.Generic;

namespace ScrumPilot.Domain.Models
{
    public class WhoDoesWhatUser
    {
        public Int32 ID { get; set; }
        public string Name { get; set; }
        public string Mail { get; set; }
        public Nullable<DateTime> Date { get; set; }

        public string LastModifiedDate
        {
            get { return Date != null ? Date.Value.ToString("f") : null; }
        }

        public string ISO8601Date
        {
            get { return Date != null ? Date.Value.ToString("o") : null; }
        }

        public int PendingScore { get; set; }
        public int PendingChangeCount { get; set; }
        public int PendingWorkItems { get; set; }
        public int CompletedHours { get; set; }
    }

    public class KeyDataIndicators
    {
        public int BugsCount { get; set; }
        public String CSSBugs { get; set; }
        public int CriticalItemsCount { get; set; }
        public String CSSCriticalItems { get; set; }
        //public int TestToDo { get; set; }
        //public String CSSTestToDo { get; set; }
        //public int CodeReviewToDo { get; set; }
        //public String CSSCodeReviewToDo { get; set; }
        public int UserstoriesCountDown { get; set; }
        public String CSSUserstoriesCountDown { get; set; }
        public int TotalScore { get; set; }
    }

    public class WorkItemSimple
    {
        public int ID { get; set; }
        public String Name { get; set; }
        public int ProjectID { get; set; }
        public String ProjectName { get; set; }
    }

    public class BugsItem : WorkItemSimple
    {
        public int Actives { get; set; }
        public int Totals { get; set; }
    }

    public class KeyPoints
    {
        public List<WorkItemProject> Projects { get; set; }
        public List<WhoDoesWhatUser> WhoDoesWhat { get; set; }
        public List<BugsItem> ReleaseBugslist { get; set; }
        public List<BugsItem> Bugslist { get; set; }
        public KeyDataIndicators KeyIndicators { get; set; }
        public String SprintName { get; set; }
        public String SprintGap { get; set; }
        public Nullable<int> KanbanIpMax { get; set; }
        public Nullable<int> KanbanTtMax { get; set; }
        public BurndownGraph BurnDown { get; set; }
    }

    public class ViewModelWhoDoesWhatUserDetail
    {
        public List<BaseProject> Projects { get; set; }
        public List<WhoDoesWhatUserDetail> UserDetails { get; set; }
    }

    public class WhoDoesWhatUserDetail : WhoDoesWhatUser
    {
        public List<ProjectKeys> ProjectsKeys { get; set; }
    }

    public class ProjectKeys
    {
        public int UserStories { get; set; }
        public int Tasks { get; set; }
        public int Bugs { get; set; }
        public int ActiveUserStories { get; set; }
        public int ActiveTasks { get; set; }
        public int ActiveBugs { get; set; }
    }

    public class BurndownGraph
    {
        public int[] XAxis { get; set; }
        public int[] YAxis { get; set; }
        public int[] IdealBurnDown { get; set; }
        public Nullable<int>[] RealBurnDown { get; set; }
    }
}
